//
//  JSGoodsFormsCell.swift
//  fho
//
//  Created by 郭颢源 on 2021/4/29.
//

import UIKit

class JSGoodsFormsCell: JSBaseViewCell {

    lazy var label:UILabel = {
        var _label = UILabel()
        _label.font = self.textFont
        _label.textColor = self.textClor
        _label.textAlignment = .right
        _label.adjustsFontSizeToFitWidth = true
        return _label
    }()
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        contentView.addSubview(label)
        label.snp.makeConstraints { (make) in
            make.right.equalTo(-self.cellMargin);
            make.centerY.equalTo(self.contentView.snp.centerY);
            make.height.equalTo(self.cellHeight - 20);
        }
    }
    
    override func initWith<T>(Model formModel: JSFormModel, VC ViewController: T) where T : BaseFormsController {
        super.initWith(Model: formModel, VC: ViewController)
        self.label.text = self.model.text;
        self.label.snp.makeConstraints { (make) in
            make.left.equalTo(self.iconBtn.snp.right).offset(10)
        }
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

}
